package com.yingxin.yx.framework.commons.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * 往来单位  是否本公司  枚举
 */

public enum ContactUnitsIsCompany {

    ZERO("0","否"),
    ONE("1","是"),
    ;

    private String isCompany;

    private String isCompanyName;


    ContactUnitsIsCompany(String isCompany, String isCompanyName) {
        this.isCompany = isCompany;
        this.isCompanyName = isCompanyName;

    }

    public String getIsCompany() {
        return isCompany;
    }

    public void setIsCompany(String isCompany) {
        this.isCompany = isCompany;
    }

    public String getIsCompanyName() {
        return isCompanyName;
    }

    public void setIsCompanyName(String isCompanyName) {
        this.isCompanyName = isCompanyName;
    }


    public static ContactUnitsIsCompany getEnum(String isCompany) {
        if ( StringUtils.isBlank( isCompany ) ) {
            return null;
        }
        for (ContactUnitsIsCompany i : ContactUnitsIsCompany.values()) {
            if ( i.getIsCompany().equals( isCompany ) ) {
                return i;
            }
        }
        return null;
    }

}
